package com.firefoxking.mysite.controller;

import com.firefoxking.mysite.dao.dto.ContentCond;
import com.firefoxking.mysite.entity.Metadata;
import com.firefoxking.mysite.service.meta.MetadataService;
import com.firefoxking.mysite.utils.MapCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

import java.util.List;

@Controller
public abstract class BaseController {

    @Autowired
    private MetadataService metadataService;

    protected MapCache cache = MapCache.single();

    public BaseController blogBaseData(Model model) {
        List<Metadata> links = metadataService.getMetadataByCond(null);
        model.addAttribute("links", links);
        return this;
    }
}
